<?php

namespace app\common\model\card;
use app\common\model\BaseModel;


/**
 * 储值卡模型
 * Class Goods
 * @package app\common\model\sharp
 */
class Card extends BaseModel
{
    protected $name = 'wxapp_card';

    /**
     * 关联文章封面图
     * @return \think\model\relation\HasOne
     */
    public function image()
    {
        return $this->hasOne('app\\store\\model\\UploadFile', 'file_id', 'image_id');
    }

    /**
     * 储值卡详情
     * @param $sharpGoodsId
     * @param array $with
     * @return static|null
     * @throws \think\exception\DbException
     */
    public static function detail($card_id, $with = ['image'])
    {
        // 整理商品数据并返回
        $model = static::get($card_id, $with);
        return $model;
    }



}